package com.java.forum.b_mapper;

import com.java.forum.a_entity.Post;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;

@Mapper
public interface PostMapper {

    Post getPostByPid(int pid);

    Integer insertPost(Post post);

    List<Post> getPostByKeyword(String keyword, Date date);//暂时只搜索标题

    List<Post> getPostByType(Integer type, Date date);

    List<Post> getAllPost(Date date);

    List<Post> getAllPostOrderByComments(Date date);

    List<Post> getAllPostOrderByLikes(Date date);

    List<Post> getAllPostOrderByViews(Date date);

    List<Post> getPostByUid(Integer uid, Date date);

    Integer ReEditPost(Post post);

    Integer PostLike(Post post);

    Integer PostUnlike(Post post);

    Integer ViewPost(Post post);

    Integer PostComment(Integer pid);

    Integer PostDeleteComment(Integer pid);

    Integer PostAddCollections(Integer pid);

    Integer PostRemoveCollections(Integer pid);

    Integer reCounterScore(Post post);

    Integer deletePost(Post post);

    Integer deletePostThenLike(Post post);

    Integer deletePostThenCollection(Post post);

    Integer deletePostThenComment(Post post);
}
